home *** CD-ROM | disk | FTP | other *** search
- /* PROCs that operate on the PixMap or the PixMap's clut must have resource
- IDs of 1000, 1020, 1040,... 1580. PROCs that operate on the BitMap must
- have resource IDs of 2000, 2020, 2040,... 2580. The BitMap is assumed to
- have the same dimentions as the PixMap. All PROCs all called with a pointer
- to the following data struct:
- */
-
- typedef struct {
- PixMapPtr pixMapPtr; /* pixMapPtr points to the PixMap struct
- in memory. (See Inside Mac V for the
- description of a PixMap struct).
- */
- BitMap *bitMapPtr; /* bitMapPtr points to the BitMap struct
- in memory. (See Inside Mac I for the
- description of a BitMap struct). The
- BitMap will initially be set to all
- white by Vision Lab on the first call
- to a BitMap PROC.
- */
- unsigned char *grayMapPtr; /* grayMapPtr is an array of 256 chars in
- memory that map a pixel value to it's
- gray level value. For example: in 4
- bit deep PixMap there might be a pixel
- with a value of 13. To find out what
- gray level this really is we look at
- the value stored at *(grayMapPtr+13).
- This will be a value from 0 to 255. 0
- is black and 255 is white.
- */
- Rect selRect; /* selRect is the rectangle that has been
- selected on the screen. If no selection
- is present then selRect is equal to the
- dimensions of the PixMap.
- */
- int minPixSize; /* minPixSize is the minimum bits needed
- per pixel. For example: an 8 bit deep
- PixMap may only really contain 5 bits
- of information.
- */
- char BitsChanged : 1; /* This flag MUST be set if you change
- any bits in the BitMap.
- */
- char PixsChanged : 1; /* This flag MUST be set if you change
- any pixels in the PixMap.
- */
- char ClutChanged : 1; /* This flag MUST be set if you change
- the clut of the PixMap.
- */
- char filler1 : 5; /* Reserved for future use - do not change!
- */
- int ProcResID; /* The resource ID of the PROC being called.
- If a PROC needs any private resources
- they should be numbered from XXXX to XX99.
- Where XXXX is the PROCs resource ID.
- */
- Handle PixHand; /* Handle to the pixel image in memory. The
- handle is locked when passed to outside
- PROCs and the dereferenced pointer is stored
- in the PixMap */
- Handle BitHand; /* Handle to the bit image in memory. The
- handle is locked when passed to outside
- PROCs and the dereferenced pointer is stored
- in the BitMap */
- unsigned long *tSizePtr; /* Total size for bar graph procedure */
- unsigned long *pSizePtr; /* Processed size for bar graph procedure */
- long filler[28]; /* reserved for future use */
-
- /* -=[]=--=[]=--=[]=--=[]=--=[]=--=[]=--=[]=--=[]=--=[]=--=[]=--=[]=--=[]=--=[]=-*/
-
- int (*getAPixel)(); /* getAPixel(x, y, mapPtr)
- int x, y;
- PixMapPtr mapPtr;
- {
- }
-
- Gets a pixel value from either a BitMap or a
- PixMap. WARNING!!! No range checking is done on
- input values!
- */
- void (*setAPixel)(); /* setAPixel(x, y, mapPtr, value)
- int x, y;
- PixMapPtr mapPtr;
- int value;
- {
- }
-
- Sets a pixel in either a BitMap or a PixMap to
- value. WARNING!!! No range checking is done on
- input values!
- */
- void (*doGM)(); /* Position, theEvent, map, data)
- Point Position;
- EventRecord *theEvent;
- unsigned char *map;
- MapDataPtr data;
- {
- }
-
- Does a gray map… more on this later.
- */
- void (*updateBarGraph)(); /* updateBarGraph()
- {
- }
-
- Call this to draw the bar graph periodically
- */
- void (*setupBarGraph)(); /* setupBarGraph(theText)
- StringPtr theText;
- {
- }
-
- Call this to initialize the bar graph. theText
- will be placed inside the bar graph and should
- say what exactly is taking so long to do.
- */
- void (*killBarGraph)(); /* killBarGraph()
- {
- }
-
- You *MUST* call this when when you are finished
- with the bar graph!
- */
- } Share, *SharePtr;
-
- typedef struct {
- int lastX;
- int lastY;
- unsigned char brightness;
- unsigned char contrast;
- } MapData, *MapDataPtr;
-
- #define getAPixelM (*AppDataPtr->getAPixel)
- #define setAPixelM (*AppDataPtr->setAPixel)
- #define doGMM (*AppDataPtr->doGM)
- #define updateBarGraphM (*AppDataPtr->updateBarGraph)
- #define setupBarGraphM (*AppDataPtr->setupBarGraph)
- #define killBarGraphM (*AppDataPtr->killBarGraph)
-
- #define pSizeM (*(AppDataPtr->pSizePtr))
- #define tSizeM (*(AppDataPtr->tSizePtr))
-